package com.room.pojo;

/**
 * @创建人 lin
 * @创建时间 2019/9/28
 * @描述
 */
public class DormResult {
    private Integer status;
    private String msg;
    private Object obj;
    
    public DormResult(){}

    public static DormResult build() {
        return new DormResult();
    }

    public static DormResult ok(String msg, Object obj) {
        return new DormResult(200, msg, obj);
    }

    public static DormResult ok(String msg) {
        return new DormResult(200, msg, null);
    }

    public static DormResult error(String msg, Object obj) {
        return new DormResult(500, msg, obj);
    }

    public static DormResult error(String msg) {
        return new DormResult(500, msg, null);
    }

    private DormResult(Integer status, String msg, Object obj) {
        this.status = status;
        this.msg = msg;
        this.obj = obj;
    }

    public Integer getStatus() {

        return status;
    }

    public DormResult setStatus(Integer status) {
        this.status = status;
        return this;
    }

    public String getMsg() {
        return msg;
    }

    public DormResult setMsg(String msg) {
        this.msg = msg;
        return this;
    }

    public Object getObj() {
        return obj;
    }

    public DormResult setObj(Object obj) {
        this.obj = obj;
        return this;
    }
}
